﻿using System;

namespace JQuery.WebKit.WebCommon.Attributes
{
    [global::System.AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
    public sealed class JavaScriptAttribute : Attribute
    {
        #region public string Name
        /// <summary>
        /// Get/Sets the Name of the JavaScriptAttribute
        /// </summary>
        /// <value></value>
        public string Name
        {
            get;
            set;
        }
        #endregion

        public string Category { get; set; }

        #region public object DefaultValue
        /// <summary>
        /// Get/Sets the DefaultValue of the JavaScriptAttribute
        /// </summary>
        /// <value></value>
        public object DefaultValue
        {
            get;
            set;
        }
        #endregion

        #region public bool IsComplex
        /// <summary>
        /// Gets the IsComplex of the JavaScriptAttribute
        /// </summary>
        /// <value></value>
        public bool IsComplex
        {
            get { return !string.IsNullOrEmpty(Name); }
        }
        #endregion

        public JavaScriptAttribute(string variableName)
        {
            this.Name = variableName;
        }
    }
}
